package com.wang.jmonkey.common.constant;

/**
 * @Description
 * @Author HeJiawang
 * @Date 2021/5/11 11:05
 */
public class SecurityConstant {

    /**
     * 登陆参数
     */
    public enum LoginParameter {
        username("username"),
        password("password"),
        code("code"),
        deviceId("deviceId"),
        oauthType("oauthType"),
        refreshToken("refreshToken"),
        ;

        private String key;

        LoginParameter(String key) {
            this.key = key;
        }

        public String getKey() {
            return key;
        }
    }

    /**
     * 退出信息
     */
    public enum Logout {
        path("/logout")     // 退出路径
        ;

        private String key;

        Logout(String key) {
            this.key = key;
        }

        public String getKey() {
            return key;
        }
    }

    /**
     * 用户认证类型
     */
    public enum OAuthType {
        refresh_token("refresh_token"),     // 刷新token
        access_token("access_token");       // 获取token

        private String key ;

        OAuthType(String key) {
            this.key = key;
        }

        public String getKey() {
            return this.key;
        }
    }

    /**
     * 安全认证相关的Key
     */
    public enum AuthKey {
        BearerSpace("Bearer "),
        JwtSigningKey("JMONKEY_JWT_KEY"),
        AUTHORIZATION("Authorization");


        private String key ;
        AuthKey(String key) {
            this.key = key;
        }

        public String getKey() {
            return this.key;
        }
    }

    public enum clientsKey {
        Client_Id("jmonkey_client_id"),
        Client_Secret("jmonkey_client_secret"),
        Grant_Type_Refresh_Token("refresh_token"),
        Grant_Type_Password("password"),
        Scopes("all"),
        ;

        private String key ;

        clientsKey(String key) {
            this.key = key;
        }

        public String getKey() {
            return this.key;
        }
    }

    /**
     * jwt中存在的key
     */
    public enum JwtContentKey {
        USER_NAME("user_name"),
        ;

        private String key ;

        JwtContentKey(String key) {
            this.key = key;
        }

        public String getKey() {
            return this.key;
        }
    }

}
